import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/6/8
 * Time:20:38
 **/
public class Main2 {
    /**
     * 每日一题-单词倒排
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            String str = sc.nextLine();
            String[] s = str.split("[^a-zA-Z]+");//按大小写字母分隔
            StringBuilder sb = new StringBuilder();
            for(int i = s.length-1;i>=0;i--) {//从后往前遍历
                sb.append(s[i]+" ");
            }
            System.out.println(sb);
        }
    }
}
